import React from "react";

export default function Index(props) {
  const {msg,onChange} = props
  // const [count, setCount] = React.useState(0)
  const [lemsg,setlemsg]=useState('这是子组件传递给父组件的数据')
 const handlechange=()=>{
   onChange(lemsg)
 }
  return (
    <div>
      {msg}
      <button onClick={handlechange}>点击切换</button>
    </div>
  )
}
